package main

import (
	"fmt"
	"html"
	"log"
	"net/http"
)

func Bootstrap() {
	http.Handle("/foo", fooHandler)

	http.HandleFunc("/bar", func(w http.ResponseWriter, r *http.Request) {
		fmt.Fprintf(w, "Hello, %q", html.EscapeString(r.URL.Path))
	})
	log.Printf("Server started on :8080")
	log.Fatal(http.ListenAndServe(":8080", nil))
}

type FooHandler struct{}

func (f FooHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
	fmt.Fprintf(w, "Hello, %q", html.EscapeString(r.URL.Path))
}

var fooHandler = FooHandler{}
